<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="jquery1.9/jquery-1.9.0.js"></script>
    <script>
        $(function(){
            $("#btn1").click(function(){
                $("#first").css("background","red");
            });
            $("#btn2").click(function(){
                $("p").css("background","green");
            });
            $("#btn3").click(function(){
                $(".hehe").css("background","yellow");
            });
            $("#btn4").click(function(){
                $(".hehe,span,#last").css("background","purple");
            });
            $("#btn5").click(function(){
                $("div.hehe").css("background","pink");
            });
            $("#btn6").click(function(){
               console.log( $("*").length);//所有的标签,包含html、head、meta......
               $("*").css("background","red");
            });
        });
    </script>
  
</head>
<body>
    <input type="button" value="ID选择器" id="btn1">
    <input type="button" value="标签选择器" id="btn2">
    <input type="button" value="类选择器" id="btn3">
    <input type="button" value="并集选择器" id="btn4">
    <input type="button" value="交集选择器" id="btn5">
    <input type="button" value="全局选择器" id="btn6">
    <div id="first">div01</div>
    <div>div02</div>
    <div>div03</div>
    <div>div04</div>
    <div>div05</div>
    <div class="hehe">div06</div>
    <div>div07</div>
    <div id="last">div08</div>
    <p>p01</p>
    <p>p02</p>
    <p class="hehe">p03</p>
    <p>p04</p>
    <p>p05</p>
    <span>span01</span>
    <span>span02</span>
    <span>span03</span>
</body>
</html>